VMaxMidi Applet
Cross-Browser Random Midi Player
Easy to use CrossBrowser Random Midi Player continuously playing randomly selected MIDI tracks. When one ends then it starts
the next random midi file that it selects. There is no guarantee that the new one is not a repeat of previous ones.
Installation instructions:
1. Download package, and upload to your server
following files from the package: vmaxmidiloader.class, vmaxmidicacher.class,
vmaxmidi.js and vmaxmidi.gif and midi files you want to use.
2. Insert the following code in your HTML document where you want the player
to appear.
(Don't use HTML editors like FrontPage or
PageMill, most of these sort of editors are quite buggy and either don't
handle JavaScript code correctly, either correct it so that it works only
in one browser)
<script>
/****** VMaxMIDI Random Midi Player Applet and Script *************/
* You are welcome to use this applet and script if and only if */
* this statement presents unchanged in all copies and derivatives */
* CopyRight = "Virtual_Max (http://come.to/vmax), 1999 */
/******************************************************************/
Registered users place your KEY below */
/******************************************************************/
var KEY = "Free Version";
titles=new Array();
var i=0;
/**********************
Define midi files here
**********************/
titles[i++]='midi/passport.mid';
titles[i++]='midi/crash.mid';
titles[i++]='midi/money.mid';
titles[i++]='midi/shine.mid';
//you can add more here..
</script>
<script src="vmaxmidi.js"></script> |
3. Edit actual MIDI file names you want to use. You can use as many names as you need, But NOT less than 3.
The player will play all them in random order, but would select next random one based on the rule that it can't be one of the last
two played titles.
Note, that only relative URLs are allowed. In case you would try to load midi files from a different server, the player
won't work due to Java Security limitations.
4. You are welcome to use this applet free with KEY = "Free Version" free of charge for non-commercial purposes, but the only
limitation of "Free Version" is that it must have a build-in link to Virtual_Max's Cafe site. If you would like to get rid of this link,
please register.
Additional tech notes:
Actually this is a combination of JavaScript, Java applet and browser plug-in.
Javascript is a glue between Applet and Plug-in. As different browsers can have different plug-ins associated
with MIDI files, then one can hardly guarantee that this applet will work for any and all cases. It requires that Java and JavaScript
be both enabled. At least it works in Netscape 3 nd 4 with "LiveAudio" default plug-in for MIDI files, for MIE4 and MIE5 with
default MediaPlayer or MediaPlayer2. Unfortunatly all three plugins have the same bug which won't allow you to implement this
control with JavaScript only. The problem is that at least on WinNT and Win95 platforms all three plug-ins won't stop at the end of
track on some MIDI file formats. So there is no way to detect that music is already over. As a workaround for this problem I
created Java Appplet (vmaxmidi.class) which load MIDI file and parse it to calculate MIDI track playtime.
This Applet also provide GUI with simple set of buttons and work as 'preloader' for next random selected MIDI file. So when one
file is over, the next one is already cached, and will be started fast. The small red rectangle under counter is indicator of loading of
next file.